package sel.me.spring.boot159.web.controller;

import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sel.me.spring.boot159.web.entity.PersonDO;
import sel.me.spring.boot159.web.service.PersonService;
import sel.me.spring.boot159.web.service.TestPersonServiceOut;

/**
 * @author shenenlu 2021年01月18日 下午14:09:18
 */
@Slf4j(topic = "TestModuleAppender")
@RestController
@RequestMapping("/person")
public class PersonController {


    @Autowired
    private PersonService personService;

    @Autowired
    private TestPersonServiceOut testPersonServiceOut;

    @GetMapping("/selectPage")
    public PageInfo<PersonDO> selectPage(){
        log.info("TestModuleLogback");
        PageInfo<PersonDO> personDOPageInfo = personService.selectPage();
        return personDOPageInfo;
    }

    @GetMapping("/testTransaction")
    public void testTransaction(){
        testPersonServiceOut.out();
    }

}
